package chapter04;

public class Java14_Object_01 {
    public static void main(String[] args) {
        // TODO 构造方法重载
        // 如果一个构造方法中，想要调用其他构造方法，那么需要使用this关键字
        User14_01 user = new User14_01();
//        User14_01 user1 = new User14_01("zhangsan");
//        User14_01 user2 = new User14_01("zhangsan","男");


    }
}
class User14_01{

    User14_01() {
        this("zhangsan");
        // 等同于User14_01 user1 = new User14_01("zhangsan");
    }
    User14_01(String name) {
        this(name,"男");
        // 等同于User14_01 user2 = new User14_01("zhangsan","男");
    }

    User14_01(String name, String sex) {
        System.out.println("user"+name+sex);
    }

}